package com.nlp.visualization.pojo.db;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author LXM
 * @Title: NLPVisualizationTools
 * @Description:
 * @date 2018/5/16下午3:19
 */
@Entity
@Table(name = "t_api_statistics", schema = "NatureLanguageProcess", catalog = "")
public class TApiStatistics {
    private int id;
    private String name;
    private String uri;
    private long time;
    private String ip;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name", nullable = false, length = 255)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "uri", nullable = false, length = 1023)
    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    @Basic
    @Column(name = "time", nullable = false)
    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    @Basic
    @Column(name = "ip", nullable = false, length = 255)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TApiStatistics that = (TApiStatistics) o;
        return id == that.id &&
                time == that.time &&
                Objects.equals(name, that.name) &&
                Objects.equals(uri, that.uri) &&
                Objects.equals(ip, that.ip);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, name, uri, time, ip);
    }
}
